package xyz.zhouzhaodong.crm.controller;


import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import xyz.zhouzhaodong.crm.dto.ExpensesDto;
import xyz.zhouzhaodong.crm.entity.Expenses;
import xyz.zhouzhaodong.crm.service.IExpensesService;
import xyz.zhouzhaodong.crm.util.NoRepeatSubmit;
import xyz.zhouzhaodong.crm.util.RestMessage;

import javax.annotation.Resource;

/**
 * <p>
 * 费用支出 前端控制器
 * </p>
 *
 * @author zhouzhaodong
 * @since 2020-07-03
 */
@RestController
@RequestMapping("/expenses")
public class ExpensesController {

    @Resource
    IExpensesService expensesService;

    /**
     * 新增费用支出
     * @param expenses
     * @return
     */
    @NoRepeatSubmit
    @RequestMapping("/add")
    public RestMessage addExpenses(Expenses expenses){
        return expensesService.addExpenses(expenses);
    }

    /**
     * 删除费用支出
     * @param expenses
     * @return
     */
    @RequestMapping("/delete")
    public RestMessage deleteExpenses(Expenses expenses){
        return expensesService.deleteExpenses(expenses);
    }

    /**
     * 修改费用支出
     * @param expenses
     * @return
     */
    @RequestMapping("/update")
    public RestMessage updateExpenses(Expenses expenses){
        return expensesService.updateExpenses(expenses);
    }

    /**
     * 查询费用支出
     * @param expensesDto
     * @return
     */
    @RequestMapping("/select")
    public RestMessage selectExpenses(ExpensesDto expensesDto){
        return expensesService.selectExpenses(expensesDto);
    }

}
